﻿Tracking = function() {
    Sim.Object.call(this);
};

Tracking.prototype = new Sim.Object();

Tracking.prototype.init = function (Id, vectors, material, radius) {
    radius = radius || 0.1;
    var randomSpline = new THREE.SplineCurve3(vectors);

    var tube = new THREE.TubeGeometry(randomSpline, 32, radius, 10, false);

    var mesh =new THREE.Mesh(tube, material);
    this.setObject3D(mesh);
    this.mesh = mesh;
    this.Id = Id;
};

Tracking.prototype.move = function (y, z) {
    this.mesh.position.y += y;
    this.mesh.position.z += z;
};


Tracking.prototype.handleMouseMove = function (x, y,hitPoint) {
    this.publish('mouseMove', x, y,hitPoint);
};

Tracking.prototype.handleMouseOver = function (x, y) {
    this.publish('mouseOver', x, y);
};

Tracking.prototype.handleMouseOut = function (x, y) {
    this.publish('mouseOut', x, y);
};